cmake_minimum_required(VERSION 3.0)

project(SuperPoint)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_LIBRARY "libstdc++")
set(CMAKE_BUILD_TYPE "release")

# Spdlog
find_package(spdlog REQUIRED)

# OpenCV
find_package(OpenCV REQUIRED)

# Eigen
find_package(Eigen3 REQUIRED)

# OnnxRuntime
include_directories("/zwj/pro/zwl/3rdparty/onnxruntime-linux-x64-gpu-1.15.1/include")
link_directories("/zwj/pro/zwl/3rdparty/onnxruntime-linux-x64-gpu-1.15.1/lib")
link_libraries(onnxruntime)

include_directories(
    ${PROJECT_SOURCE_DIR}/include
    ${OpenCV_INCLUDE_DIRS}
    ${Eigen_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} SHARED
    src/superpoint.cpp
    src/lightglue.cpp
)

set(third_party_lib
    PUBLIC
    ${PROJECT_NAME}
    ${OpenCV_LIBRARIES}
    PRIVATE 
    spdlog::spdlog_header_only
)

add_executable(superpoint src/sp_main.cpp)
add_executable(sp_lg src/lg_main.cpp)
add_executable(img_track src/img_track.cpp)

target_link_libraries(superpoint ${third_party_lib})
target_link_libraries(sp_lg ${third_party_lib})
target_link_libraries(img_track ${third_party_lib})

